home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 …SCII & the Runetime Code / ADC Developer CD (1992-07) (''Butch ASCII And The Runtime Code'')_iso / Dev.CD 199207.iso / Development Platforms / Apple II / DTS Apple II Sample Code / IR 2.0 / Source Code / IR / IR.r < prev    next >
Encoding:
Text File  |  1992-02-25  |  15.4 KB  |  607 lines  |  [TEXT/MPS ]

  1. /*****************************************************************************
  2. *
  3. * IR 2.0 Resources
  4. * The resource descriptions for IR, version 2.0
  5. *
  6. * These resources were created with the assistance of a popular development
  7. * utility for the Apple IIgs and then tweaked and amplified by hand to
  8. * cover new 6.0-specific features.
  9. *
  10. * by Matt Deatherage
  11. *
  12. * Copyright © 1992 Apple Computer, Inc.  All rights reserved
  13. *
  14. * Release history
  15. *
  16. * 2.0b1        02/18/92    Matt Deatherage
  17. * First release -- all previous incarnations of this were inline assembly
  18. *
  19. * 2.0b2        02/20/92    Matt Deatherage
  20. * Fixed ID problems.  Eliminated "IR.equ.r" file, including the #defines
  21. * in this file instead.
  22. *
  23. * 2.0b3        02/21/92    Matt Deatherage
  24. * Eliminated dead resources.  Added the blast text attribute to any static
  25. * text controls that need no LETextBox2 features (styles or justification).
  26. * Added lowercase key equivalents like I had before the Popular Development
  27. * Utility helpfully upshifted them all.  Made the rTwoRects resource locked
  28. * so it won't move and I don't have to lock it.  Changed a couple of resources
  29. * to be noCrossBank so pointer arithmetic is simplified.
  30. *
  31. * 2.0f1     02/24/92    Matt Deatherage
  32. * Removed the unused "irBusy" alert because, come to think of it, it doesn't
  33. * make a whole lot of sense to display an alert that says "IR is busy" when
  34. * no one can do anything about it.  Changed the "About" alert to be locked
  35. * so we can use the new AlertWindow flag to not dispose of it.  This lets
  36. * the custom rectangle we pass stick around after AlertWindow releases the
  37. * resource.  Marked the window parameter resource as "locked" so we don't
  38. * have to lock it in code.
  39. *
  40. * 2.0 (!)    02/25/92    Matt Deatherage
  41. * Changed version to 2.0.
  42. *
  43. *****************************************************************************/
  44.  
  45. #include "TypesIIgs.r"
  46.  
  47. #define If_duplicate_LEText_CNT 57 /* move this line to the top of this file */
  48. #define Preferences_LEText_CNT 40 /* move this line to the top of this file */
  49. #define Permanently_LEText_CNT 37 /* move this line to the top of this file */
  50. #define LETXTBOX_00000005_CNT 33 /* move this line to the top of this file */
  51. #define About_LEText_CNT 284 /* move this line to the top of this file */
  52.  
  53. // --- type $8001 defines
  54.  
  55. #define IR_Init_Icon $00000001
  56.  
  57. // --- type $8003 defines
  58.  
  59. #define Preferences_Ctl_List $00001003
  60.  
  61. // --- type $8004 defines
  62.  
  63. #define Prefs_Title $00000001
  64. #define Install_NDAs_now $00000002
  65. #define Install_FEs_permanently $00000003
  66. #define Permanently_stat_text $00000004
  67. #define If_duplicate_stat_text $00000005
  68. #define Install_new_Radio $00000006
  69. #define Try_to_kill_old_Radio $00000007
  70. #define Always_remove_old_Radio $00000008
  71. #define Version_control $0000000A
  72. #define Accept $0000000B
  73. #define Cancel $0000000C
  74. #define Save $0000000D
  75. #define Open_NDAs_now $0000000E
  76. #define Do_OpenFailed $0000000F
  77. #define Do_Alerts_on_Problems $00000010
  78. #define Underline $00000011
  79. #define Big_Rectangle $00000012
  80.  
  81. // --- type $8006 defines
  82.  
  83. #define PSTR_00000001 $00000001
  84. #define PSTR_00000002 $00000002
  85. #define PSTR_00000003 $00000003
  86. #define PSTR_00000004 $00000004
  87. #define PSTR_00000005 $00000005
  88. #define PSTR_00000006 $00000006
  89. #define PSTR_00000007 $00000007
  90. #define PSTR_00000008 $00000008
  91. #define PSTR_00000009 $00000009
  92. #define PSTR_0000000A $0000000A
  93. #define PSTR_0000000B $0000000B
  94. #define PSTR_0000000C $0000000C
  95. #define PSTR_0000000D $0000000D
  96.  
  97. // --- type $800B defines
  98.  
  99. #define Preferences_LEText $00000001
  100. #define Permanently_LEText $00000002
  101. #define If_duplicate_LEText $00000003
  102. #define LETXTBOX_00000005 $00000005
  103. #define About_LEText $00000006
  104.  
  105. // --- type $800E defines
  106.  
  107. #define Preferences_Window $00000FFA
  108.  
  109. // --- type $8015 defines
  110.  
  111. #define irDuplicateWontDie $00000001
  112. #define irAboutAlert $00000002
  113. #define irNoFinder $00000003
  114.  
  115. // --- type $801A defines
  116.  
  117. #define WindowRects $00000001
  118. // --- type $8029 defines
  119.  
  120. #define IR_Version $00000001
  121.  
  122. // --- type $802A defines
  123.  
  124. #define Comment1 $00000001
  125. #define Comment2 $00000002
  126.  
  127. // --- Icon Definitions
  128.  
  129. resource rIcon (IR_Init_Icon, preload) {
  130.         $8000,                    // kind
  131.         $0014,                    // height
  132.         $0016,                    // width
  133.  
  134.         $"FFFFFFFFFFFFFFFFFFFFFF"
  135.         $"FFFFFFFFFFFFFFFFFFFFFF"
  136.         $"FFFF0000000FF0FFFFFFFF"
  137.         $"FFFF0FFFFF0F0F0FFFFFFF"
  138.         $"FFFF0F444F00F1F0FFFFFF"
  139.         $"FFFF0F444F0F111F0FFFFF"
  140.         $"FFFF0F444FF11111F0FFFF"
  141.         $"FFFF0F444F1111111F0FFF"
  142.         $"FFFF0F444FFF111FFFF0FF"
  143.         $"00000F444F0F111F00000F"
  144.         $"F0FFFF444FFF111F0FFFFF"
  145.         $"FF0F4444444F111F0FFFFF"
  146.         $"FFF0F44444FF111F0FFFFF"
  147.         $"FFFF0F444F0F111F0FFFFF"
  148.         $"FFFFF0F4F00F111F0FFFFF"
  149.         $"FFFFFF0F0F0FFFFF0FFFFF"
  150.         $"FFFFFFF0FF0000000FFFFF"
  151.         $"FFFFFFFFFFFFFFFFFFFFFF"
  152.         $"FFFFFFFFFFFFFFFFFFFFFF"
  153.         $"FFFFFFFFFFFFFFFFFFFFFF",
  154.  
  155.         $"0000000000000000000000"
  156.         $"0000000000000000000000"
  157.         $"0000FFFFFFF00F00000000"
  158.         $"0000FFFFFFF0FFF0000000"
  159.         $"0000FFFFFFFFFFFF000000"
  160.         $"0000FFFFFFFFFFFFF00000"
  161.         $"0000FFFFFFFFFFFFFF0000"
  162.         $"0000FFFFFFFFFFFFFFF000"
  163.         $"0000FFFFFFFFFFFFFFFF00"
  164.         $"FFFFFFFFFFFFFFFFFFFFF0"
  165.         $"0FFFFFFFFFFFFFFFF00000"
  166.         $"00FFFFFFFFFFFFFFF00000"
  167.         $"000FFFFFFFFFFFFFF00000"
  168.         $"0000FFFFFFFFFFFFF00000"
  169.         $"00000FFFFFFFFFFFF00000"
  170.         $"000000FFF0FFFFFFF00000"
  171.         $"0000000F00FFFFFFF00000"
  172.         $"0000000000000000000000"
  173.         $"0000000000000000000000"
  174.         $"0000000000000000000000";
  175. };
  176.  
  177. // --- Control List Definitions
  178.  
  179. resource rControlList (Preferences_Ctl_List, $0000) {
  180.         {
  181.         Prefs_Title,         // control 1
  182.         Install_NDAs_now,         // control 2
  183.         Install_FEs_permanently,         // control 3
  184.         Permanently_stat_text,         // control 4
  185.         If_duplicate_stat_text,         // control 5
  186.         Install_new_Radio,         // control 6
  187.         Try_to_kill_old_Radio,         // control 7
  188.         Always_remove_old_Radio,         // control 8
  189.         Version_control,         // control 9
  190.         Accept,         // control 10
  191.         Cancel,         // control 11
  192.         Save,         // control 12
  193.         Open_NDAs_now,         // control 13
  194.         Do_OpenFailed,         // control 14
  195.         Do_Alerts_on_Problems,         // control 15
  196.         Underline,         // control 16
  197.         Big_Rectangle,         // control 17
  198.         };
  199. };
  200.  
  201. // --- Control Templates
  202.  
  203. resource rControlTemplate (Prefs_Title, $0000) {
  204.         $00000001,                // ID
  205.         {  5, 10, 15,163},      // rect
  206.         statTextControl {{
  207.                  $0000,           // flag
  208.                  $1002,           // moreFlags
  209.                  $00000000,      // refCon
  210.                  Preferences_LEText,     // textRef
  211.                  Preferences_LEText_CNT, // textSize
  212.                  $0000            // just
  213.         }};
  214. };
  215.  
  216. resource rControlTemplate (Install_NDAs_now, $0000) {
  217.         $00000002,                // ID
  218.         { 21, 14, 31,220},      // rect
  219.         checkControl {{
  220.                  $0000,           // flag
  221.                  $3002,           // moreFlags
  222.                  $00000000,      // refCon
  223.                  PSTR_00000001,  // titleRef
  224.                  $0001,           // initialValue
  225.                  0,                // colorTableRef
  226.                  {"N","n",$0100,$0100}  // key equivalents
  227.         }};
  228. };
  229.  
  230. resource rControlTemplate (Install_FEs_permanently, $0000) {
  231.         $00000003,                // ID
  232.         { 45, 14, 54,242},      // rect
  233.         checkControl {{
  234.                  $0000,           // flag
  235.                  $3002,           // moreFlags
  236.                  $00000000,      // refCon
  237.                  PSTR_00000002,  // titleRef
  238.                  $0000,           // initialValue
  239.                  0,                // colorTableRef
  240.                  {"F","f",$0100,$0100}  // key equivalents
  241.         }};
  242. };
  243.  
  244. resource rControlTemplate (Permanently_stat_text, $0000) {
  245.         $00000004,                // ID
  246.         { 54, 42, 63,135},      // rect
  247.         statTextControl {{
  248.                  $0004,           // flag (blast text)
  249.                  $1002,           // moreFlags
  250.                  $00000000,      // refCon
  251.                  Permanently_LEText,     // textRef
  252.                  Permanently_LEText_CNT, // textSize
  253.                  $0000            // just
  254.         }};
  255. };
  256.  
  257. resource rControlTemplate (If_duplicate_stat_text, $0000) {
  258.         $00000005,                // ID
  259.         { 91, 22,101,253},      // rect
  260.         statTextControl {{
  261.                  $0004,           // flag (blast text)
  262.                  $1002,           // moreFlags
  263.                  $00000000,      // refCon
  264.                  If_duplicate_LEText,     // textRef
  265.                  If_duplicate_LEText_CNT, // textSize
  266.                  $0000            // just
  267.         }};
  268. };
  269.  
  270. resource rControlTemplate (Install_new_Radio, $0000) {
  271.         $00000006,                // ID
  272.         {106, 14,115,220},      // rect
  273.         radioControl {{
  274.                  $0000,           // flag
  275.                  $3002,           // moreFlags
  276.                  $00000000,      // refCon
  277.                  PSTR_00000003,  // titleRef
  278.                  $0001,           // initialValue
  279.                  0,                // colorTableRef
  280.                  {"I","i",$0100,$0100}  // key equivalents
  281.         }};
  282. };
  283.  
  284. resource rControlTemplate (Try_to_kill_old_Radio, $0000) {
  285.         $00000007,                // ID
  286.         {116, 14,126,224},      // rect
  287.         radioControl {{
  288.                  $0000,           // flag
  289.                  $3002,           // moreFlags
  290.                  $00000000,      // refCon
  291.                  PSTR_00000004,  // titleRef
  292.                  $0000,           // initialValue
  293.                  0,                // colorTableRef
  294.                  {"T","t",$0100,$0100}  // key equivalents
  295.         }};
  296. };
  297.  
  298. resource rControlTemplate (Always_remove_old_Radio, $0000) {
  299.         $00000008,                // ID
  300.         {126, 14,136,228},      // rect
  301.         radioControl {{
  302.                  $0000,           // flag
  303.                  $3002,           // moreFlags
  304.                  $00000000,      // refCon
  305.                  PSTR_00000005,  // titleRef
  306.                  $0000,           // initialValue
  307.                  0,                // colorTableRef
  308.                  {"A","a",$0100,$0100}  // key equivalents
  309.         }};
  310. };
  311.  
  312. resource rControlTemplate (Version_control, $0000) {
  313.         $00000009,                // ID
  314.         {  5,181, 15,270},      // rect
  315.         statTextControl {{
  316.                  $0000,               // flag
  317.                  $1000,               // moreFlags (ref is by POINTER)
  318.                  $00000000,     // refCon
  319.                  $00000000,     // textRef (NIL at first)
  320.                  0,             // textSize (no text at first)
  321.                  $FFFF            // just
  322.         }};
  323. };
  324.  
  325. resource rControlTemplate (Accept, $0000) {
  326.         $0000000B,                // ID
  327.         {143,194,156,270},      // rect
  328.         simpleButtonControl {{
  329.                  $0001,           // flag
  330.                  $3002,           // moreFlags
  331.                  $00000000,      // refCon
  332.                  PSTR_00000006,  // titleRef
  333.                  0,                // colorTableRef
  334.                  {"\$0D", "\$0D",$0000,$0000}  // key equivalents
  335.         }};
  336. };
  337.  
  338. resource rControlTemplate (Cancel, $0000) {
  339.         $0000000C,                // ID
  340.         {143,112,156,188},      // rect
  341.         simpleButtonControl {{
  342.                  $0000,           // flag
  343.                  $3002,           // moreFlags
  344.                  $00000000,      // refCon
  345.                  PSTR_00000007,  // titleRef
  346.                  0,                // colorTableRef
  347.                  {"\$1B", "\$1B",$0000,$0000}  // key equivalents
  348.         }};
  349. };
  350.  
  351. resource rControlTemplate (Save, $0000) {
  352.         $0000000D,                // ID
  353.         {143, 14,156, 90},      // rect
  354.         simpleButtonControl {{
  355.                  $0000,           // flag
  356.                  $3002,           // moreFlags
  357.                  $00000000,      // refCon
  358.                  PSTR_00000008,  // titleRef
  359.                  0,                // colorTableRef
  360.                  {"S","s",$0100,$0100}  // key equivalents
  361.         }};
  362. };
  363.  
  364. resource rControlTemplate (Open_NDAs_now, $0000) {
  365.         $0000000E,                // ID
  366.         { 33, 14, 42,234},      // rect
  367.         checkControl {{
  368.                  $0000,           // flag
  369.                  $1002,           // moreFlags
  370.                  $00000000,      // refCon
  371.                  PSTR_00000009,  // titleRef
  372.                  $0001            // initialValue
  373.         }};
  374. };
  375.  
  376. resource rControlTemplate (Do_OpenFailed, $0000) {
  377.         $0000000F,                // ID
  378.         { 66, 14, 75,248},      // rect
  379.         checkControl {{
  380.                  $0000,           // flag
  381.                  $1002,           // moreFlags
  382.                  $00000000,      // refCon
  383.                  PSTR_0000000A,  // titleRef
  384.                  $0000            // initialValue
  385.         }};
  386. };
  387.  
  388. resource rControlTemplate (Do_Alerts_on_Problems, $0000) {
  389.         $00000010,                // ID
  390.         { 78, 14, 87,264},      // rect
  391.         checkControl {{
  392.                  $0000,           // flag
  393.                  $1002,           // moreFlags
  394.                  $00000000,      // refCon
  395.                  PSTR_0000000B,  // titleRef
  396.                  $0001            // initialValue
  397.         }};
  398. };
  399.  
  400. resource rControlTemplate (Underline, $0000) {
  401.         $00000011,                // ID
  402.         { 16, 10, 17,270},      // rect
  403.          rectangleControl {{
  404.                  $FF02,           // flag
  405.                  $1000,           // moreFlags
  406.                  $00000000      // refCon
  407.         }};
  408. };
  409.  
  410. resource rControlTemplate (Big_Rectangle, $0000) {
  411.         $00000012,                // ID
  412.         { 97,  8,139,272},      // rect
  413.          rectangleControl {{
  414.                  $FF01,           // flag
  415.                  $1000,           // moreFlags
  416.                  $00000000     // refCon
  417.         }};
  418. };
  419.  
  420. // --- rPString Templates
  421.  
  422. resource rPString (PSTR_00000001, $0000) {
  423.         "Install NDAs instantly"
  424. };
  425.  
  426. resource rPString (PSTR_00000002, $0000) {
  427.         "Install Finder extensions"
  428. };
  429.  
  430. resource rPString (PSTR_00000003, $0000) {
  431.         "Install a new copy"
  432. };
  433.  
  434. resource rPString (PSTR_00000004, $0000) {
  435.         "Try to remove the old one"
  436. };
  437.  
  438. resource rPString (PSTR_00000005, $0000) {
  439.         "Always remove the old one"
  440. };
  441.  
  442. resource rPString (PSTR_00000006, $0000) {
  443.         "Accept"
  444. };
  445.  
  446. resource rPString (PSTR_00000007, $0000) {
  447.         "Cancel"
  448. };
  449.  
  450. resource rPString (PSTR_00000008, $0000) {
  451.         "Save"
  452. };
  453.  
  454. resource rPString (PSTR_00000009, $0000) {
  455.         "Open NDAs if possible"
  456. };
  457.  
  458. resource rPString (PSTR_0000000A, $0000) {
  459.         "Give others first shot at files"
  460. };
  461.  
  462. resource rPString (PSTR_0000000B, $0000) {
  463.         "Tell me about problems"
  464. };
  465.  
  466. resource rPString (PSTR_0000000C, $0000) {
  467.         "Button"
  468. };
  469.  
  470. resource rPString (PSTR_0000000D, $0000) {
  471.         "Button"
  472. };
  473.  
  474. // --- rTextForLETextBox2 Templates
  475.  
  476. resource rTextForLETextBox2 (Preferences_LEText, $0000) {
  477.         TBStyleBold
  478.         "IR Preferences"
  479. };
  480.  
  481. resource rTextForLETextBox2 (Permanently_LEText, $0000) {
  482.         "permanently"
  483. };
  484.  
  485. resource rTextForLETextBox2 (If_duplicate_LEText, $0000) {
  486.         "If you choose an installed file"
  487. };
  488.  
  489. // --- Window Templates
  490.  
  491. resource rWindParam1 (Preferences_Window, locked) {
  492.         $208A,                    // plFrame (frame bits)
  493.         NIL,                      // plTitle (no Title)
  494.         $00000000,                // plRefCon
  495.         {  0,  0,  0,  0},      // plZoomRect
  496.         NIL,                      // plColorTable (standard colors)
  497.         {$0000, $0000},          // plYOrigin, plXOrigin
  498.         {$0000, $0000},          // plDataHeight, plDataWidth
  499.         {$0000, $0000},          // plMaxHeight, plMaxWidth
  500.         {$0000, $0000},          // plVerScroll, plHorScroll
  501.         {$0000, $0000},          // plVerPage, plHorPage
  502.         $00000000,                // plInfoText (info RefCon)
  503.         $0000,                    // plInfoHeight
  504.         { 28,180,190,460},      // plPosition
  505.         infront,                  // plPlane
  506.         Preferences_Ctl_List,         // plControlList
  507.         $0009                     // plInDesc
  508. };
  509.  
  510. // --- rAlertString Templates
  511.  
  512. resource rAlertString (irDuplicateWontDie, $0000) {
  513.         "74~This item is already installed and IR can"
  514.         "\$D5"
  515.         "t remove the currently installed version.  What do you want to d"
  516.         "o?~^#1~Install another copy"
  517.         "\$00"
  518. };
  519.  
  520. resource rAlertString (irAboutAlert, locked, NoCrossBank) {
  521.         "0XXYYxxyy"                        // custom size
  522.         "1"                                // custom icon
  523.         "\$01\$00\$00\$00"                // our Icon resource ID ($00000002)
  524.         "~"
  525.         TBCenterJust
  526.         TBFont
  527.         TBShaston
  528.         "\$01\$08"
  529.         TBStyleBold
  530.         TBEndOfLine
  531.         "IR"
  532.         TBEndOfLine
  533.         TBStylePlain
  534.         TBEndOfLine
  535.         "The multi-purpose, on-the-fly "
  536.         "component installer thingy."
  537.         TBEndOfLine
  538.         TBEndOfLine
  539.         "By Matt Deatherage"
  540.         TBEndOfLine
  541.         TBEndOfLine
  542.         "Copyright 1991-1992, Apple Computer, Inc.  "
  543.         "All Rights Reserved."
  544.         TBEndOfLine
  545.         TBEndOfLine
  546.         "Special thanks to Dave Lyons, "
  547.         "Andy Nicholas and the one and "
  548.         "thankfully only Tim Swihart"
  549.         TBEndOfLine
  550.         "(the first)."
  551.        "~"
  552.        "^Cool"
  553.        "\$00"
  554. };
  555.         
  556.  
  557. resource rAlertString (irNoFinder, $0000) {
  558.         "73~Installing Finder Extensions will probably have no effect unl"
  559.         "ess you return to the Finder before rebooting your Apple IIgs co"
  560.         "mputer.  Install them anyway?~#1~^Install"
  561.         "\$00"
  562. };
  563.  
  564. resource rVersion (0x1) {
  565.     {
  566.         0x2,
  567.         0x0,
  568.         0x0,
  569.         release,
  570.         0x0
  571.     },
  572.     verUS,
  573.     "IR",
  574.     "Copyright 1989-92 Apple Computer, Inc."
  575. };
  576.  
  577. resource rComment (0x1) {
  578.     "IR lets you install desk accessories, "
  579.     "system setup files, Finder Extensions and "
  580.     "some GS/OS drivers from the Finder (or "
  581.     "some other programs) without rebooting.\n\n"
  582.     "Written by Matt Deatherage, Developer "
  583.     "Technical Support, Apple Computer, Inc.  "
  584.     "Thanks to Andy Nicholas, Tim Swihart and "
  585.     "(of course) to Dave “Make it do everything I "
  586.     "want” Lyons."
  587. };
  588.  
  589. resource rComment (0x2) {
  590.     "IR lets you double-click on system setup "
  591.     "files (like this one), desk accessories, "
  592.     "some GS/OS drivers and Finder Extensions "
  593.     "to install them without rebooting.  "
  594.     "Unfortunately, you have to install IR in "
  595.     "the normal way to make it work.  Put this "
  596.     "file in the “System.Setup” folder in the "
  597.     "“System” folder of your startup volume and "
  598.     "restart your Apple IIgs computer."
  599. };
  600.  
  601. resource rTwoRects (WindowRects,Locked,noCrossBank) {
  602.     {25,20,187,300},    // window rect for 320 mode
  603.     {25,180,187,460}    // window rect for 640 mode
  604. };
  605.  
  606.  
  607.